# Contributor: Jean-Louis Fuchs <jean-louis.fuchs@adfinis-sygroup.ch>
# Maintainer: Jean-Louis Fuchs <jean-louis.fuchs@adfinis-sygroup.ch>
pkgname=py3-attrs
pkgver=23.1.0
pkgrel=1
pkgdesc="Python classes without boilerplate"
url="http://www.attrs.org"
arch="noarch"
license="MIT"
depends="python3"
makedepends="
	py3-gpep517
	py3-hatch-vcs
	py3-hatchling
	"
subpackages="$pkgname-pyc"
source="py-attrs-$pkgver.tar.gz::https://github.com/python-attrs/attrs/archive/$pkgver.tar.gz
	no-fancy.patch
	check.py
	"
builddir="$srcdir/attrs-$pkgver"

replaces="py-attrs" # Backwards compatibility
provides="py-attrs=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver \
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 "$srcdir"/check.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
e96727d68081a761effcdf5a5d62d66902e7f5229879711739fd14d257b7f1c71ddab84309ffeff161bfc4da3a2b130eda4fad920b9f5bc3134bed138d05c16c  py-attrs-23.1.0.tar.gz
60e6468ed2b862a7822f2625af8835b2310b15b39e2399071bfb4621b2db9c997a95130fc66931b33c307657883ab129397e377e619c9c1d36d3cec1157c09a9  no-fancy.patch
36bcb4ec145f29e79fc019dc39672f13dc94e1c07225968af51f19e17b2aede0b23dafdff265f1e77a251e53af9802bcf1db5068900ee0a03e1bfc1051c01ef9  check.py
"
